<?php

namespace app\common\validate;

use app\admin\validate\Admin;
use think\Validate;

class AdminPermissionValidate extends Validate
{
    protected $rule = [
        'permission_name' => 'require|min:1|max:20|unique:admin_permission',
        'type' => 'require',
        'status' => 'require',
        'url' => 'require',
//        'url' => 'requireIf:type,2',
    ];


    protected $field = [
        'permission_name' => '名称',
        'type' => '类型',
        'status' => '状态',
        'url' => '路径',
    ];

    protected $scene = [
        'add' => ['permission_name','type','status','url'],
        'edit' => ['permission_name','type','status','url'],
    ];

}